package com.wsx.rpc.jna;

import com.sun.jna.Native;

/**
 * @author wangshuaixin
 * @Title: com.wsx.rpc.jna.Test
 * @Description: TODO
 * @date 2018/11/16
 */
public class Test {

    public static void main(String[] args) {
        Lib lib = (Lib) Native.loadLibrary("test", Lib.class);

        int rtn = lib.add(11, 9);
        System.out.println("first value :" + rtn);


        int len = 3;
        int[] a = {11, 18, 21};
        int[] b = {44, 56, 100};
        int[] c = new int[3];
        lib.addArray(a, b, c, len);

        for (int i = 0; i < len; i++) {
            System.out.println("addArray index " + i + ":value:" + c[i]);
        }

        String input = "kun";
        String out = lib.stringFun(input);
        System.out.println("string out value :" + out);
    }
}
